﻿using Microsoft.Extensions.DependencyInjection;
using System.Configuration;
using System.Data;
using System.Windows;
using WpfDemo.ViewModels;
using WpfDemo.Views;

namespace WpfDemo
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public new static App Current => (App)Application.Current;
        public IServiceProvider Services { get;}

        public App()
        {
            Services = ConfiureServices();
        }

        private static IServiceProvider ConfiureServices()
        {
            var services = new ServiceCollection();
            services.AddTransient<MainWindowViewModel>();
            services.AddTransient<ButtonView>();
            services.AddTransient<ButtonViewModel>();
            services.AddTransient<CalendarView>();
            services.AddTransient<CalendarViewModel>();
            services.AddTransient<SliderView>();
            services.AddTransient<SliderViewModel>();
            services.AddTransient<IconView>();
            services.AddTransient<IconViewModel>();
            return services.BuildServiceProvider();
        }
    }

}
